﻿<!DOCTYPE html>
<html>
<head>
	<meta charset="utf-8">
	<title>搜索</title>
	<link rel="stylesheet" type="text/css" href="__STATIC__/pc/css/setdiv.css">
	<script src="__STATIC__/admin/js/jquery.js"></script>
</head>
<style type="text/css">
	body{
		font-size: 12px;
		margin: 0;
		padding: 0;
	}
	.pic{
		text-align: center;
		height: 328px;
    	overflow: hidden;
	}
	.pic img{
		height: 350px;
	}
	.lianjie{
		margin-left: 34px;
		font-size: 18px;
		color: #7B7B7B;
		margin-top: 14px;
	}
	.lists{
		width: calc(100% - 70px);
		margin: 0 auto;
		font-size: 18px;
	}
	table{
		border:1px solid #0EC0D5;
		border-radius: 20px;
		border-collapse:collapse;
		margin-top: 45px;
	}
	table td{
		padding: 10px 0px;
		width: 20%;
    	text-align: center;
	}
	tbody tr{
		width: 20%;
	}
	tbody{
		color: #383838;
	}
	.allbtn{
		display:flex;
		-webkit-display:flex;
		justify-content: flex-end;
		padding-right: 34px;
		margin-top: 28px;
	}
	.btn3{
        width: 92px;
        height: 33px;
        background: #00B1D7;
        text-align: center;
        line-height: 33px;
        border-radius: 10px;
        color: #fff;
        font-size: 14px;
    }
	.btn1,.btn2{
		width: 93px;
		height: 33px;
		text-align: center;
		line-height: 33px;
		color: #fff;
		border-radius: 5px;
		margin-left: 30px;
	}
	.btn1{
		background: #FF8610;
	}
	.btn2{
		background: #0EC0D5;
	}
</style>
<body>
	<div style="background: #00B1D7;color: #fff;">
		<include file="Public:nav" />
	</div>
	<div class="pic">
		<img src="__STATIC__/pc/img/company_select.jpg">
	</div>
	<include file="Public:boder" />
	
	
	<div class="bodycenter" >
		
		
	<div class="lianjie">首页>{$company_name}</div>
	<div class="lists">
		<volist name="project_result" id="v">
		<table width="100%">
			<thead>
				<tr style="background: #0EC0D5;color: #fff;">
					<td align="center" colspan="5">{$v.type_name}</td>
				</tr>
				<tr style="color: #383838;">
					<td align="center">序号</td>
					<td align="center">项目名称</td>
					<td align="center">申请时间/批次</td>
					<td align="center">补助金额</td>
					<td align="center">证书编号</td>
				</tr>
			</thead>
			<tbody>
				<volist name="v.type_array" id="vo">
					<tr>
						<td align="center">{$vo.id}</td>
						<td align="center">{$vo.item_name}</td>
						<td align="center">{$vo.time_batch}</td>
						<td align="center">{$vo.subsidy_amount/1000}</td>
						<td align="center">{$vo.certificate_no}</td>
					</tr>
				</volist>
			</tbody>
		</table>
		</volist>
	</div>
	<div class="allbtn">
		<if condition="$is_attention eq 0 || $is_attention eq -1">
            <td align="center">
            	<a href="javascript:void(0)" style="display:block;" class="btn1" onclick="change_class(this)" <if condition="$is_attention eq -1">status="1"<else />status="0"</if>company_id="{$company_id}">
						+关注
				</a>
			</td>
		</if>
		<if condition="$is_attention eq 1">
			<td align="center">
				<a href="javascript:void(0)" style="display:block;" class="btn3" onclick="change_class(this)" status="-1" company_id="{$company_id}">
					取消关注
				</a>
			</td>
		</if>
		<a href="javascript:void(0)" class="btn2" onclick="javascript:history.go(-1);">返回</a>
	</div>
	
	
	</div>
	
	
	
	<include file="Public:footer" />
	<script>
		function change_class(obj){
	    	var status = $(obj).attr('status');
	    	var company_id = $(obj).attr('company_id');
	    	var class_name = $(obj).attr('class');
	    	var bool = false;

	    	var formData = new FormData();
	    	formData.append('status',status);
	        formData.append('company_id',company_id);

	    	$.ajax({
	            url:"{:url('Company/follow')}",
	            type:'POST',
	            data:formData,
	            async:false,
	            processData:false,
	            contentType:false,
	            success:function(result){
	            	if(result.code == 0){
	            		layer.alert(result.msg);
	            		bool = true;
	            	}
	            }

	        });

	        if(bool){
	        	return false;
	        }


	    	$(obj).removeClass('btn1');
	    	$(obj).removeClass('btn3');
	    	//$(obj).attr('status','');

	    	if(class_name == 'btn1'){
	    		$(obj).attr("class","btn3");
	    		$(obj).text("取消关注");
	    		$(obj).attr('status','-1');
	    	}else{
	    		$(obj).attr("class","btn1");
	    		$(obj).attr('status','1');
	    		$(obj).text("+关注");
	    	}
	    	
	    
		}
	</script>
</body>
</html>